* Replication code for creating table OA6 in the online appendix

* Uses the 2012 RES survey, dataset publicly available through the Harvard Dataverse, https://doi.org/10.7910/DVN/24202

svyset psu [pweight=kish_wgt]

*DVs
recode v22 (1=1) (2=1) (3=0) (4=0) (5=0) (7=0) (8=0), gen(appputx2)
recode v22 (1=5) (2=4) (3=3) (4=2) (5=1) (7=.) (8=.), gen(appputx5)
recode v48_5 (1=1) (2=1) (3=0) (4=0) (7=0) (8=0) (.=0), gen(attputx2)
recode v48_5 (1=4) (2=3) (3=2) (4=1) (7=.) (8=.) (.=.), gen(attputx4)
generate votput12=1 if v59==5
replace votput12=0 if votput12==.
generate pubestirx2=1 if v72==5
replace pubestirx2=0 if pubestirx2==.

*Creating index "proputin" from the 4 binary measures of Putin support 
egen proputin = rowmean(appputx2 attputx2 votput12 pubestirx2)

*IVs of interest
recode v90 (1=1) (2=1) (3=0) (4=0) (7=0) (8=0), gen(antiwestx2)
recode v90 (1=4) (2=3) (3=2) (4=1) (7=.) (8=.), gen(antiwestx4)
recode v94_1 (1=1) (2=1) (3=0) (4=0) (7=0) (8=0) (9=0), gen(usnatothreatx2)
recode v94_1 (1=4) (2=3) (3=2) (4=1) (7=.) (8=.) (9=.), gen(usnatothreatx4)
recode v92_1 (1=1) (2=1) (3=0) (4=0) (6=0) (7=0) (8=0) (.=0), gen(puantiwestx2)
recode v92_1 (1=4) (2=3) (3=2) (4=1) (6=.) (7=.) (8=.) (.=.), gen(puantiwestx4)

*Controls
recode v120 (1=0) (2=0) (3=0) (4=0) (5=0) (6=1) (7=1) (8=1) (98=0) (99=0), gen(highedx2)
recode v118 (2=1) (1=0), gen(female)
recode v128 (1=0) (2=0) (3=0) (4=1) (5=1) (7=0) (8=0), gen(ecpocdownx2)
recode v127 (1=1) (2=1) (3=0) (4=0) (5=0) (6=0) (7=0) (97=0) (98=0), gen(poorx2)
*Variable "age" already saved in the dataset
generate russian=1 if v121==1
replace russian=0 if russian==.
generate commsize=popquintile


svy: regress proputin antiwestx2 ecpocdownx2 poorx2 age female commsize russian highedx2
eststo: margins, dydx(*)
svy: regress proputin antiwestx4 ecpocdownx2 poorx2 age female commsize russian highedx2
eststo: margins, dydx(*)

svy: regress proputin usnatothreatx2 ecpocdownx2 poorx2 age female commsize russian highedx2
eststo: margins, dydx(*)
svy: regress proputin usnatothreatx4 ecpocdownx2 poorx2 age female commsize russian highedx2
eststo: margins, dydx(*)

svy: regress proputin puantiwestx2 ecpocdownx2 poorx2 age female commsize russian highedx2
eststo: margins, dydx(*)
svy: regress proputin puantiwestx4 ecpocdownx2 poorx2 age female commsize russian highedx2
eststo: margins, dydx(*)


esttab using FRregs2012summary20220121.rtf, compress b(%9.2f) se star(+ 0.1 * 0.05 ** 0.01) coeflabel(antiusx2 "Anti-US x2" antiusx4 "Anti-US x4" antiwestx2 "Anti-West x2" antiwestx4 "Anti-West x4" usnatothreatx2 "US-NATO threat x2" usnatothreatx4 "US-NATO threat x4" puantiwestx2 "Putin is anti-West x2" puantiwestx4 "Putin is anti-West x4" ecpocdownx2 "Pocketbook down" poorx2 "Poor" age "Age" female "Female" commsize "Community size" russian "Russian" highedx2 "Higher education") mtitles("RES2012" "RES2012" "RES2012" "RES2012" "RES2012" "RES2012") title("Table X. Average marginal effects of different aspects of anti-Westernism on probability of supporting Putin with economic and demographic controls, OLS") addnote("Dependent variables are indices of all measures of Putin support found in the given survey, constructed by converting each measure to a binary variable and averaging each individual's 'score' across these variables. Included measures of Putin support are: 2016 - job approval, affective attachment, vote intention, and perception Putin is the best politician to manage Russia's international interests. The notation 'x2' refers to a measure of anti-Westernism that codes all people giving anti-Western responses as 1 and codes all others 0, while the notation 'x4' refers to a measure of anti-Westernism that consists of a four-point scale and that drops from the analysis all people who do not pick a number on this scale. The control variables for the economy, sex, nationality, and higher education are binary, coding people who hold the disposition 1 and coding all others 0. The control variable age reports respondents' age in years, and 'community size' consists of the scale supplied by each survey agency on the size of the population center where a respondent lives. All regressions are OLS, but using logit or ordinal logit produces no substantial difference. The same patterns are also found if one breaks down the indices into their component measures of Putin support.") fonttbl(\f0\fnil Times New Roman; ) replace 
eststo clear








